package net.wanho.util;

/**
 * 管理当前登录用户的信息
 */
public class CurrentUtil {

    private static final ThreadLocal<Integer> localUserId = new ThreadLocal<>();

    public static void setUserId(Integer userId){
        localUserId.set(userId);
    }

    public static Integer getUserId(){
        return localUserId.get();
    }

    public static void removeUserId(){
        localUserId.remove();
    }

}
